package HuaWeiPractice;

import java.util.Scanner;

/**
 * created by ysy 2022/3/5 21:25
 * 功能:输入一个正整数，按照从小到大的顺序输出它的所有质因子（重复的也要列举）（如180的质因子为2 2 3 3 5 ）
 *
 * @author 杨双洋
 * @version 1.0
 * @Email Yangsybd@163.com
 */
public class ZhiShuYinZi {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);//200
        long num = sc.nextLong();
        long k = (long) Math.sqrt(num);
        //System.out.println(25*8);

//这么写没有问题，用一个？: 判断是就能判断输入的数如果是无因子的数或者1   如测试65477
        for (int i = 2; i <= k; i++) {
            while (num % i == 0) {
                System.out.print(i + " ");
                num = num / i;
            }
        }
        System.out.print(num == 1 ? 1 : num + " ");
    }
}

